package br.uninove.jimage.to;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author thalys
 */
@Entity
@Table(name = "METODOS_DE_CLASSIFICAO")
@NamedQueries({
    @NamedQuery(name = "MetodosDeClassificacaoTO.findAll", query = "SELECT m FROM MetodosDeClassificacaoTO m"),
    @NamedQuery(name = "MetodosDeClassificacaoTO.findById", query = "SELECT m FROM MetodosDeClassificacaoTO m WHERE m.id = :id"),
    @NamedQuery(name = "MetodosDeClassificacaoTO.findByNome", query = "SELECT m FROM MetodosDeClassificacaoTO m WHERE m.nome = :nome")})
public class MetodosDeClassificacaoTO implements Serializable {

	
    private static final long serialVersionUID = 1L;
    @Id
	@Basic(optional = false)
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

    @Basic(optional = false)
    @Column(name = "NOME", unique=true, length=255)
    private String nome;

    public MetodosDeClassificacaoTO() {
    }

    public MetodosDeClassificacaoTO(Long id) {
        this.id = id;
    }

    public MetodosDeClassificacaoTO(int Long, String nome) {
        this.id = id;
        this.nome = nome;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((nome == null) ? 0 : nome.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MetodosDeClassificacaoTO other = (MetodosDeClassificacaoTO) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (nome == null) {
			if (other.nome != null)
				return false;
		} else if (!nome.equals(other.nome))
			return false;
		return true;
	}

	public String toString() {
		return nome.toString();
	}

	
    
    
}
